//
//  main.swift
//  SiwftTest
//
//  Created by edy on 2025/10/9.
//

import Foundation

print("Hello, World!")


let aInt8: Int8 = -1

let bytes = ByteBackpacker.pack(aInt8)

let aInt: Int = ByteBackpacker.unpack(bytes)

//Double(aInt8)
Int8(Float(3))

print("\(aInt8), aInt = \(aInt)")

//let a: UInt8 = UInt8.max
//let b: Int8 = Int8(truncatingIfNeeded: a)
//let c: Int = Int(truncatingIfNeeded: b)
//
//print("\(a), \(b), \(c)")

//let uMax = UInt.max - 1
//let iUMax = Int(truncatingIfNeeded: uMax)
//let iUMax2 = Int(bitPattern: uMax)
//print("\(uMax), \(iUMax), \(iUMax2)")

//let i = Int.max
//let uMax = UInt(truncatingIfNeeded: i)
//let uMax2 = UInt(bitPattern: i)
//print("\(i), \(uMax), \(uMax2)")
